<template>
<div class="home">
  <h2>
    Home当前计数：{{setupCounter}}
  </h2>
  <button @click="increment">+1</button>
</div>
</template>
<script setup>
import {computed,toRef} from 'vue'
import {useStore} from 'vuex'
const store=useStore()

const storeCounter=computed(()=>{
  return store.state.counter
})

const setupCounter=toRef(store.state,'counter')

function increment(){
  store.commit('increment')
}


</script>

<style scoped>

</style>